package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.system.domain.WeekResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.OrderMapper;
import com.ruoyi.system.domain.Order;
import com.ruoyi.system.service.IOrderService;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * 充电订单信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-28
 */
@Service
public class OrderServiceImpl implements IOrderService 
{
    @Autowired
    private OrderMapper orderMapper;

    /**
     * 查询充电订单信息
     * 
     * @param oId 充电订单信息主键
     * @return 充电订单信息
     */
    @Override
    public Order selectOrderByOId(Integer oId)
    {
        return orderMapper.selectOrderByOId(oId);
    }

    /**
     * 查询充电订单信息列表
     * 
     * @param order 充电订单信息
     * @return 充电订单信息
     */
    @Override
    public List<Order> selectOrderList(Order order)
    {
        return orderMapper.selectOrderList(order);
    }

    /**
     * 新增充电订单信息
     * 
     * @param order 充电订单信息
     * @return 结果
     */
    @Override
    public int insertOrder(Order order)
    {
        return orderMapper.insertOrder(order);
    }

    /**
     * 修改充电订单信息
     * 
     * @param order 充电订单信息
     * @return 结果
     */
    @Override
    public int updateOrder(Order order)
    {
        return orderMapper.updateOrder(order);
    }

    /**
     * 批量删除充电订单信息
     * 
     * @param oIds 需要删除的充电订单信息主键
     * @return 结果
     */
    @Override
    public int deleteOrderByOIds(Integer[] oIds)
    {
        return orderMapper.deleteOrderByOIds(oIds);
    }

    /**
     * 删除充电订单信息信息
     * 
     * @param oId 充电订单信息主键
     * @return 结果
     */
    @Override
    public int deleteOrderByOId(Integer oId)
    {
        return orderMapper.deleteOrderByOId(oId);
    }

    /**
     * 查询今日充电度数
     */
    @Override
    public Double selectTodayc(){
        return orderMapper.selectTodayc();
    };

    /**
     * 查询今日充电度数
     */
    @Override
    public Integer selectCountTodayc(){
        return orderMapper.selectCountTodayc();
    };

    /**
     * 查询昨天充电度数
     */
    @Override
    public Double selectYesterdayc(){
        return orderMapper.selectYesterdayc();
    };

    /**
     * 查询今日充电次数
     */
    @Override
    public Integer selectCountYesterdayc(){
        return orderMapper.selectCountYesterdayc();
    };

    /**
     * 查询本周充电度数
     */
    @Override
    public List<WeekResult> selectWeekc(){
        return orderMapper.selectWeekc();
    };

    /**
     * 查询本周充电次数
     */
    @Override
    public List<WeekResult> selectCountWeekc(){
        return orderMapper.selectCountWeekc();
    };

    /**
     * 查询上周充电度数
     */
    @Override
    public List<WeekResult> selectLastWeekc(){
        return orderMapper.selectLastWeekc();
    };

    /**
     * 查询上周充电次数
     */
    @Override
    public List<WeekResult> selectCountLastWeekc(){
        return orderMapper.selectCountLastWeekc();
    };

    /**
     * 查询支付方式占比
     */
    @Override
    public List<Map<String,Object>> selectTypePercentage(){
        return orderMapper.selectTypePercentage();
    };

    /**
     * 查询今日充电订单
     */
    @Override
    public List<Map<String,Object>> selectTodayOrder(){
        return orderMapper.selectTodayOrder();
    };
}
